package com.cao.service;

import com.cao.dao.BookMapper;
import com.cao.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: huahua
 * @Date: 2020-12-14 13:30
 */

public class BookServiceImpl implements BookService {

    //service层调dao层
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int save(Books books) {
        return bookMapper.save(books);
    }

    public int delBookById(Integer id) {
        return bookMapper.delBookById(id);
    }

    public Books queryBookById(Integer id) {
        return bookMapper.queryBookById(id);
    }

    public List<Books> queryBookList() {
        return bookMapper.queryBookList();
    }

    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    public List<Books> queryBookByName(String bookName) {
        return bookMapper.queryBookByName(bookName);
    }
}
